<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- 3.使用组件 -->
        <!-- <mynav/>
            如果myNav是这样一个变量
        -->
        <my-nav></my-nav>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        // 1.创建对象 -- 组件和new Vue只差了一个data属性。
        let myNav = {
            template: "<p>这是一个导航</p>",
            data() {
                return {

                }
            },
            methods: {},
            watch: {},
            computed: {},
            beforeCreate() {

            },
            created() {

            },
            beforeMount() {},
            mounted() {}
        }



        const app = new Vue({
            el: "#app",
            // 2，注册组件
            components: {
                myNav
            }
        })
    </script>
</body>
</html>